package com.hoko.blur.processor;

import com.hoko.blur.HokoBlur;
import com.hoko.blur.anno.Scheme;

/**
 * 模糊处理器工厂
 *
 * @author
 * @date 2021/08/03
 */
class BlurProcessorFactory {

    /**
     * 得到模糊处理器
     *
     * @param scheme 计划
     * @param builder 构建器
     * @return {@link BlurProcessor}
     */
    static BlurProcessor getBlurProcessor(@Scheme int scheme, HokoBlurBuild builder) {

        BlurProcessor blurProcessor = null;

        switch (scheme) {
            case HokoBlur.SCHEME_RENDER_SCRIPT:
//                blurProcessor = new RenderScriptBlurProcessor(builder);
                break;
            case HokoBlur.SCHEME_OPENGL:
                blurProcessor = new OpenGLBlurProcessor(builder);
                break;
            case HokoBlur.SCHEME_NATIVE:
                blurProcessor = new NativeBlurProcessor(builder);
                break;
            case HokoBlur.SCHEME_JAVA:
                blurProcessor = new OriginBlurProcessor(builder);
                break;
            default:
                throw new IllegalArgumentException("Unsupported blur scheme!");
        }

        return blurProcessor;
    }
}
